#ifndef errors_h
#define errors_h


// Error codes.
enum {
  ERR_NO_ERROR = 0,
  ERR_UNKNOW,
  ERR_MEMORY,
  ERR_IO,
  ERR_ILLEGAL_MOVE,
  ERR_ILLEGAL_POSITION,
  ERR_ILL_FORMED_SAN,
  ERR_AMBIGUOUS_SAN,
  ERR_UNDO,
  ERR_BOOK_FORMAT,
  ERR_LAST  // do not use this one
};


// Returns the last error code.
int error_last();

// Set the error code and return it.
int error_set(int code);

// Return a string representing the given error code.
const char* error_string(int code);


#endif  // errors_h

